export default defineNuxtRouteMiddleware((to, from) => {
  if (to.path !== "/login" && !useCookie("token").value) {
    const path = from.path === "/account/logout" ? "/" : from.path;
    return navigateTo({ path: "/login", query: { to: path } });
  }
});
